package com.ms.pda.adapter

import androidx.databinding.ViewDataBinding
import com.blankj.utilcode.util.CollectionUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.ms.pda.BR
import com.ms.pda.R
import com.ms.pda.model.vo.SubmitFailedVO

class SubmitFailedRVAdapter(layoutResId: Int, data: MutableList<SubmitFailedVO>?) :
    BaseQuickAdapter<SubmitFailedVO, BaseDataBindingHolder<ViewDataBinding>>(layoutResId, data) {

    constructor() : this(
        R.layout.item_submit_failed,
        CollectionUtils.newArrayList()
    )

    override fun convert(holder: BaseDataBindingHolder<ViewDataBinding>, item: SubmitFailedVO) {
        holder.dataBinding?.setVariable(BR.data, item)
        holder.dataBinding?.setVariable(BR.index, holder.layoutPosition + 1)
        holder.dataBinding?.executePendingBindings()
    }
}